﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace HotelManageSystem.Models
{
    public class WageModelDetial
    {
        [Display(Name = "编号")]
        public int Id { get; set; }

        [Display(Name = "员工编号")]
        public int EmployeeId { get; set; }

        [Display(Name = "员工姓名")]
        public string Name { get; set; }

        [Display(Name = "基本工资")]
        public decimal BasicWage { get; set; }

        [Display(Name = "保险基数")]
        public decimal BasicValue { get; set; }

        [Display(Name = "养老保险")]
        public decimal EndowmentAssurance { get; set; }

        [Display(Name = "医疗保险")]
        public decimal MedicalInsurance { get; set; }

        [Display(Name = "失业保险")]
        public decimal UnemploymentInsurance { get; set; }

        [Display(Name = "工伤保险")]
        public decimal EmploymentInjuryInsurance { get; set; }

        [Display(Name = "生育保险")]
        public decimal MaternityInsurance { get; set; }

        [Display(Name = "公积金")]
        public decimal ProvidentFund { get; set; }

        [Display(Name = "扣除")]
        public decimal TakeOff { get; set; }

        [Display(Name = "补贴")]
        public decimal Subsidy { get; set; }

        [Display(Name = "实发工资")]
        public decimal ActualWage
        {
            get
            {
                return BasicWage - EndowmentAssurance - MedicalInsurance - UnemploymentInsurance
                       - EmploymentInjuryInsurance - MaternityInsurance - ProvidentFund - TakeOff + Subsidy;
            }
        }

        [Display(Name = "发放日期")]
        [DataType(DataType.Date)]
        public DateTime WageDay { get; set; }

        [Display(Name = "备注")]
        [StringLength(20, ErrorMessage = "长度不能超过20个字符")]
        public string Remark { get; set; }
    }
}